package com.wx.freemarker.tag;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.wx.entity.WxFansUser;
import com.wx.freemarker.BaseFreeMarkerTag;
import com.wx.service.WxFansUserService;

import freemarker.template.TemplateModelException;

/**
 * 用户信息查询
 * @author 
 */
@Component
public class WxFansUserTag extends BaseFreeMarkerTag<WxFansUser>{
	
	@Resource
	private WxFansUserService wxFansUserService;

	@SuppressWarnings("rawtypes")
	@Override
	protected WxFansUser exec(Map params) throws TemplateModelException {
		if(params==null||params.get("wxUserId")==null){
			return null;
		}
		
		Long wxUserId = Long.parseLong(params.get("wxUserId").toString());
		return wxFansUserService.selectByWxUserId(wxUserId);
	}
}
